package com.leetcode;

/**
 * 翻转二叉树
 *
 * @author winson
 * @create 2022-04-12 10:48
 */
public class InvertTreeSolution {

    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode left = invertTree(root.left);
        TreeNode right = invertTree(root.right);
        root.left = right;
        root.right = left;
        return root;
    }

}
